package third.A4;

import java.util.ArrayList;
import java.util.List;

class Customer {
    private String customerId;
    private String name;
    private List<Order> orders;

    public Customer(String customerId, String name) {
        this.customerId = customerId;
        this.name = name;
        this.orders = new ArrayList<>();
    }

    public void addOrder(Order order) {
        orders.add(order);
    }
}

class Order {
    private String orderId;
    private Customer customer;
    private List<OrderDetail> orderDetails;
    private Payment payment;

    public Order(String orderId, Customer customer) {
        this.orderId = orderId;
        this.customer = customer;
        this.orderDetails = new ArrayList<>();
    }

    public void addOrderDetail(OrderDetail orderDetail) {
        orderDetails.add(orderDetail);
    }

    public void setPayment(Payment payment) {
        this.payment = payment;
    }
}

class OrderDetail {
    private Product product;
    private int quantity;

    public OrderDetail(Product product, int quantity) {
        this.product = product;
        this.quantity = quantity;
    }
}

class Product {
    private String productId;
    private String name;

    public Product(String productId, String name) {
        this.productId = productId;
        this.name = name;
    }
}

class Payment {
    private String paymentId;

    public Payment(String paymentId) {
        this.paymentId = paymentId;
    }
}